package com.oa.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.oa.service.PageService;
import com.oa.util.AppUtil;
import com.oa.util.PageBean;
import com.opensymphony.xwork2.ActionSupport;

@Controller
@Scope("prototype")
public class PageAction extends ActionSupport{
	private static final long serialVersionUID = 1L;
	// 通过spring 注入分页服务类
	@Resource(name="pageService")
	private PageService service;
	private PageBean pageBean;
	private List list;
	private int page=1;
	public PageService getService() {
		return service;
	}
	public void setService(PageService service) {
		this.service = service;
	}
	public PageBean getPageBean() {
		return pageBean;
	}
	public void setPageBean(PageBean pageBean) {
		this.pageBean = pageBean;
	}
	public List getList() {
		return list;
	}
	public void setList(List list) {
		this.list = list;
	}
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	
	public String selectMark(){
		this.service = AppUtil.getBean("pageService", PageService.class);
		this.pageBean = service.queryForPage(5, page, "Mark");
		this.list = pageBean.getList();
		
		return "selectMark";
	}
	
	
	public String execute() throws Exception {
		return "NONE";
	}
}
